import { ObjCreate } from "../common/ObjCreate";
import { ResFileConst } from "../../resource/ResFileConst";
import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
import { FilterConst } from "../../../component/gconst/FilterConst";
import { GLoadedButton } from "../../../../com/mui/controls/GLoadedButton";
//class CrossTaskGetTaskBtn
    
    export  class CrossTaskGetTaskBtn /* flash.display.Sprite */
    {
        constructor()
        {
            
            this.createChildren();
            return;
        }

        /* internal  */createChildren(): void
        {
            this._btn = ObjCreate.createGLoadedButton(ResFileConst.CrossTaskGetBtn, 0, 0, 150, 48, this);
            this._bmpBtnLabel = ObjCreate.createBitmap(null, 15, 15, this);
            return;
        }

        public update(arg1: string, arg2: Boolean=true): void
        {
            this._bmpBtnLabel.bitmapData = GlobalClass.getBitmapData(arg1);
            this.mouseEnabled = arg2;
            this.mouseChildren = arg2;
            if (arg2) 
            {
                this._btn.enabled = true;
                this._bmpBtnLabel.filters = [];
            }
            else 
            {
                this._btn.enabled = false;
                this._bmpBtnLabel.filters = [FilterConst.colorFilter];
            }
            this._bmpBtnLabel.x = (this._btn.width - this._bmpBtnLabel.width) / 2;
            this._btn.drawNow();
            return;
        }

        /* internal */ /* var */_btn: GLoadedButton;

        /* internal */ /* var */_bmpBtnLabel: Object /* flash.display.Bitmap */;
    }
